home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / cm / cmtqueue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-06  |  1.1 KB  |  32 lines

  1. // CmTQueue.h
  2. // -----------------------------------------------------------------
  3. // Compendium - C++ Container Class Library
  4. // Copyright (C) 1992-1994, Glenn M. Poorman, All rights reserved
  5. // -----------------------------------------------------------------
  6. // Queue template definition.
  7. // -----------------------------------------------------------------
  8.  
  9. #ifndef _CMTQUEUE_H
  10. #define _CMTQUEUE_H
  11.  
  12. #include <cm/include/cmtlist.h>
  13.  
  14. template <class T> class CmTQueue : public CmTLinkedList<T> {
  15. public:
  16.   CmTQueue() {}                                 // Default queue constructor.
  17.   CmTQueue(const CmTQueue<T>&);                 // Queue copy constructor.
  18.  ~CmTQueue() {}                                 // Queue destructor.
  19.  
  20.   CmTQueue<T>& operator=(const CmTQueue<T>&);   // Assignment operator.
  21.  
  22.   Bool     push (const T&);                     // Push item into queue.
  23.   T        pop  ();                             // Pop front item from queue.
  24.   const T& peek () const;                       // Return copy of front item.
  25. };
  26.  
  27. #if defined(__TURBOC__) || defined(__xlC__)
  28. #include <cm/include/cmtqueue.cc>
  29. #endif
  30.  
  31. #endif
  32.